package Demo1;


import java.util.HashMap;
import java.util.LinkedList;
import java.util.Queue;

class Solution {
    public int firstUniqChar(String s) {
        HashMap<Character,Integer> map = new HashMap<>();
        Queue<Pair> queue = new LinkedList<>();
        for(int i = 0;i<s.length();i++){
            map.get
            queue.offer(new Pair(s.charAt(i),i));
        }

        while(!queue.isEmpty()){
            if(map.get(queue.peek().ch) == 1){
                return queue.poll().index;
            }
            queue.poll();
        }
        return -1;
    }
    public class Pair{
        public char ch;
        public int index;
        public Pair(char ch,int index){
            this.ch = ch;
            this.index = index;
        }
    }
}
